import { caseApproveList, approveCase } from '@/api/filing'

export default defineStore('useFiling', {
  state: () => ({}),
  getters: {},
  actions: {
    //案件审批列表
    async getFilingList(params) {
      let url = $globalRequestUrl({
        url: caseApproveList,
      })

      try {
        const rep = await $globalRequest(url, params, { method: 'POST' })
        return rep
      } catch (error) {
        return error
      }
    },

    //审批
    async approveTask(params) {
      let url = $globalRequestUrl({
        url: approveCase,
      })

      try {
        const rep = await $globalRequest(url, params, { method: 'PUT' })
        return rep
      } catch (error) {
        return error
      }
    },
  },
})
